﻿CREATE TABLE [dbo].[Customer_View_Log] (
    [id]          INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [CusId]       UNIQUEIDENTIFIER NULL,
    [CusName]     NVARCHAR (100)   NULL,
    [UserId]      VARCHAR (30)     NULL,
    [UserName]    NVARCHAR (20)    NULL,
    [UpTime]      DATETIME         CONSTRAINT [DF_Customer_View_Log_UpTime] DEFAULT (getdate()) NULL,
    [ProtectId]   INT              NULL,
    [ProtectUser] VARCHAR (50)     NULL,
    [ProtectName] NVARCHAR (20)    NULL,
    [ProtectDate] DATETIME         NULL,
    [CompanyId]   INT              NULL,
    CONSTRAINT [PK_Customer_View_Log] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Customer_View_Log_CusName]
    ON [dbo].[Customer_View_Log]([CusName] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Customer_View_Log_UpTime]
    ON [dbo].[Customer_View_Log]([UpTime] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Customer_View_Log_UserName]
    ON [dbo].[Customer_View_Log]([UserName] ASC);

